Skip to content

Commit

Permalink
fix: iOS virtualbackground color (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
EkaanshArora authored Feb 14, 2022
1 parent e48f61b commit 5fcf108
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ios/RCTAgora/Base/BeanCovertor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func mapToTranscodingUser(_ map: [String: Any]) -> AgoraLiveTranscodingUser {

func mapToColor(_ map: [String: Any]) -> UIColor {
return UIColor(
red: CGFloat((map["red"] as! NSNumber).intValue),
green: CGFloat((map["green"] as! NSNumber).intValue),
blue: CGFloat((map["blue"] as! NSNumber).intValue),
red: (map["red"] as! CGFloat) / 255,
green: (map["green"] as! CGFloat) / 255,
blue: (map["blue"] as! CGFloat) / 255,
alpha: 1.0
)
}
Expand Down
15 changes: 10 additions & 5 deletions src/common/Classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,22 +481,28 @@ export class TranscodingUser {
}

/**
* Color.
* Color for [`VirtualBackgroundSource`]{@link VirtualBackgroundSource}
*/
export class Color {
/**
* Red.
* Red value (0 - 255)
*/
red: number;
/**
* Green.
* Green value (0 - 255)
*/
green: number;
/**
* Blue.
* Blue value (0 - 255)
*/
blue: number;

/**
* Create a color for [`VirtualBackgroundSource`]{@link VirtualBackgroundSource}
* @param red Red value (0 - 255)
* @param green Green value (0 - 255)
* @param blue Blue value (0 - 255)
*/
constructor(red: number, green: number, blue: number) {
this.red = red;
this.green = green;
Expand Down Expand Up @@ -1799,7 +1805,6 @@ export class VirtualBackgroundSource {
}
}


/**
* The information of an audio file, which is reported in [`RequestAudioFileInfo`]{@link RequestAudioFileInfo}.
*
Expand Down

0 comments on commit 5fcf108

Please sign in to comment.